<template>
  <div>
    <navs></navs>
    <div class="wrap-back" v-show="shows">
    <!-- 顶部区域开始 -->
    <div class="movie-detail">
      <div class="movie-filter"></div>
      <!-- 背景图开始 -->
      <div class="poster-background">
      </div>
      <!-- 背景图结束 -->
      <div class="detail">
        <!--海报帧开始-->
        <div class="poster">
          <img :src="detailList.haibao"></img>
        </div>
        <!--海报帧结束-->
        <!-- 内容区域开始 -->
        <div class="content">
          <div class="title line-ellipsis">{{detailList.title1}}</div>
          <div class="score line-ellipsis">{{detailList.price}}</div>
          <div class="type line-ellipsis">{{detailList.weizhi}}</div>
          <div class="type line-ellipsis">{{detailList.timer}}</div>
        </div>
        <!-- 内容区域结束 -->
      </div>

        <div class="like-wrap">
            <span><van-icon name="like-o" /><b> 想看</b></span>
            <span><van-icon name="star-o" /><b> 看过</b></span>
        </div>
    </div>
    <!-- 顶部区域结束 -->

    <div class="jieshao-wrap">
        <p>演出详情</p>
        <img :src="detailList.jieshaoImage" alt="">
        <p>购买须知</p>
        <img src="../../assets/loginImg/buyXZ.jpg" alt="">
    </div>
  </div>
  <div class="nowBuy" @click="buy()"><span>立即预订</span></div>
  </div>
</template>

<script>
import { Toast } from 'vant';
import navs from '../show/search.vue'
export default {
  name: "WorkspaceJsonShowdetail",

  data() {
    return {
      detailList: [],
      shows:false
    };
  },
  components:{
    navs
  },

  mounted() {
    let ids = this.$route.query.ids;
    this.$http
      .get("/yanchuDetil", {
        params: {
          ids,
        },
      })
      .then((res) => {
        console.log(res);
        this.detailList = res.data.data[0];
        this.shows = true
      });
  },

  methods: {
    // 跳转到订单页面
    buy(){
      if(sessionStorage.getItem('cookie-session')){
        this.$router.push({path:'/showOrder',query:{ids:this.detailList.ids}})
      }else{
        Toast.fail('请先登录');
      }
    }
  },
};
</script>

<style lang="scss" scoped>
.wrap-back{
    background: #fff;
}
.movie-detail {
  overflow: hidden;
  z-index: 1;
  height: 288px;
  position: relative;
  cursor: pointer;
}
.movie-detail .movie-filter {
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  background-color: #333;
}
.poster-background {
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  position: absolute;
  -webkit-filter: blur(1.2rem);
  filter: blur(1.2rem);
  background-size: cover;
  background-repeat: no-repeat;
  background-image: url("../../assets/loginImg/bac-bg.jpg");
  opacity: 0.8;
}
.movie-detail .detail {
  height: 150px;
  padding: 19px 30px 19px 15px;
}
.movie-detail .detail {
  display: flex;
  height: 150px;
  padding: 19px 30px 19px 15px;
}
.movie-detail .detail .poster img {
  width: 110px;
  height: 150px;
  box-sizing: border-box;
}
.movie-detail .detail .content {
  flex: 1;
  overflow-x: hidden;
  margin-left: 12.5px;
  line-height: 1;
  color: #fff;
}
.movie-detail .detail .content .title {
  font-size: 20px;
  margin-top: 2px;
  font-weight: 700;
  overflow: hidden;
}
.line-ellipsis {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.movie-detail .detail .content .score {
  font-size: 18px;
  font-weight: 700;
  color: #fc0;
  margin-top: 17px;
}
.movie-detail .detail .content .type {
  margin-top: 17px;
  font-size: 12px;
  color: #fff;
  opacity: 0.8;
}
.introduction {
  padding: 10px;
  font-size: 16px;
  background-color: #fff;
}
.line-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  text-overflow: ellipsis;
  word-wrap: break-word;
  word-break: break-all;
  overflow: hidden;
}
.introduction .more {
  text-align: center;
}
.introduction .more img {
  width: 10px;
  height: 10px;
}
.actors {
  margin-top: 10px;
  padding: 10px;
  font-size: 16px;
  background-color: #fff;
}
.actors .title {
  margin-bottom: 10px;
  font-size: 16px;
}
.actors .actors-list {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  white-space: nowrap;
}
.actors .actors-list .actors-item {
  width: 80px;
  display: inline-block;
  margin-right: 10px;
}
.actors .actors-list img {
  margin-bottom: 10px;
  display: block;
  width: 100%;
  height: 112px;
  border-radius: 2px;
}
.like-wrap{
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    >span{
        box-sizing: border-box;
        padding: 8px 30px;
        display: flex;
        align-items: center;
        
        background: rgba(228, 227, 227, 0.5);
        border-radius: 20px;
    }
}
.jieshao-wrap{
    padding: 10px;
    >img{
        width: 100%;
        height: auto;
    }
}
.nowBuy{
  width: 100%;
  text-align: center;
  position: fixed;
  bottom: 20px;
  z-index: 10;
  right: 0;
  left: 0;
  >span{
    padding: 10px 80px;
    box-sizing: border-box;
    border-radius:20px ;
    background: rgb(226, 28, 28);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
  }
}
</style>